package com.softdev.service.impl;

import com.softdev.pojo.Skill;
import com.softdev.repo.SkillRepository;
import com.softdev.service.SkillService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
public class SkillServiceImpl implements SkillService {

    @Resource
    private SkillRepository skillRepository;

    @Override
    public List<Skill> get() {
        return skillRepository.findAll();
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean add(Skill skill) {

        skillRepository.save(skill);

        return true;
    }
}
